/*
* Copyright (C) Microsoft. All rights reserved.  
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License.  You may obtain a copy 
* of the License at http://www.apache.org/licenses/LICENSE-2.0  
* 
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
* MERCHANTABLITY OR NON-INFRINGEMENT. 
*
* See the Apache License, Version 2.0 for specific language governing 
* permissions and limitations under the License.
*
*/
#pragma once

#include <memory>
#include <string>
#include <baja/common.hpp>
#include <baja/stream/stream_interfaces.hpp>

namespace baja { namespace storage {

enum known_folders
{
    picture_library
};

struct istorage_file : public baja::ibase
{
    BAJA_INTERFACE_NOTAG(istorage_file);

    virtual std::wstring fileName() = 0;
    virtual std::wstring fullFileName() = 0;
    virtual baja::uint64 modifiedDateTime() = 0;

    virtual void initializeAsync(
        std::function<void(bool)> initializeCompleted
        ) = 0;

    virtual void initializeAsync(
        std::wstring fullFileName,
        std::function<void(bool success)> initializeCompleted
        ) = 0;

    virtual void initializeAsync(
        const known_folders& knownFolders,
        std::wstring fileName,
        std::function<void(bool)> initializeCompleted) = 0;

    virtual void initializeFromPickerAsync(
        const known_folders& knownFolders,
        const std::vector<std::wstring>& fileTypeFilter,
        std::function<void(bool success, bool cancelled)> pickCompleted
        ) = 0;

    virtual void deleteAsync(
        std::function<void(bool)> deleteCompleted) = 0;

    virtual void copyToAsync(
        std::wstring targetFullFileName,
        std::function<void(bool success, std::shared_ptr<istorage_file> copiedFile)> copyCompleted
        ) = 0;

    virtual void createMemoryStreamFromFileAsync(
        std::function<void(bool success, const std::shared_ptr<imemory_stream>& ms)> completedFunc
        ) = 0;
};

}} // baja::storage